package com.lanou3g.code0523.permission;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public abstract class BaseFilter implements Filter {
    private  FilterConfig filterConfig;
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        this.filterConfig = filterConfig;
    }
    protected FilterConfig getFilterConfig(){
        return filterConfig;
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
            throws IOException, ServletException {
        this.doFilter((HttpServletRequest) servletRequest,(HttpServletResponse) servletResponse,filterChain);
    }



    public abstract void doFilter(HttpServletRequest servletRequest,
                         HttpServletResponse servletResponse,
                         FilterChain filterChain)
            throws IOException, ServletException;



        @Override
    public void destroy() {

    }
}
